<!--订单列表-->
<style scoped lang="less">
.gridbg {
  background-color: #fefefe;
}
.btns {
  width: 80%;
  height: 0.7rem;
  line-height: 0.7rem;
  margin-left: 10%;
  margin-top: 0.5rem;
  border-radius: 4px;
  background: rgba(79, 161, 164, 1);
  text-align: center;
  color: #ffffff;
}
.order-list {
  .todo {
    height: 0.86rem;
    line-height: 0.86rem;
    padding: 0 0.2rem;
    .tag {
      height: 0.56rem;
      line-height: 0.56rem;
      padding: 0 0.2rem;
      margin-left: 0.1rem;
      background: #ff7202;
      color: #fff;
      border-radius: 0.28rem;
    }
  }
  .list-order-warp {
    background: #fff;
    .title {
      padding: 10px;
      color: #888;
      font-size: 14px;
      border-bottom: 1px solid #ebebeb;
    }
    .con {
      padding: 0.1rem 0.2rem;
      border-bottom: 1px solid #ebebeb;
      .cargo {
        margin: 0.1rem;
        height: 1.3rem;
        width: 1.3rem;
        text-align: center;
        border-radius: 0.08rem;
        background: #edf8f8;
        overflow: hidden;
        i {
          display: block;
          height: 1rem;
          line-height: 1rem;
          font-size: 0.6rem;
          color: #77babd;
        }
        p {
          height: 0.3rem;
          line-height: 0.3rem;
          font-size: 0.2rem;
          color: #fff;
          background: #77babd;
        }
      }
      .msg {
        margin-left: 0.2rem;
        font-size: 13px;
        line-height: 0.5rem;
      }
    }
    .btn-grp {
      padding: 0.1rem 0.2rem 0.1rem 0;
      text-align: right;
      .btn {
        width: 70%;
        height: 36px;
        margin-left: 15%;
        margin-top: 50%;
        border-radius: 4px;
      }
    }
  }
}
.ipt-sty {
    width: 80%; 
    height:1rem;
    margin-left:10%;
    margin-top:5rem;
    border-radius: 0.1rem;
    text-align: center;
    font-size: 18px;
}
.ipt-sty {
    width: 80%; 
    height:1rem;
    margin-left:10%;
    margin-top:5rem;
    border-radius: 0.1rem;
    margin-bottom: 0.1rem;
    text-align: center;
    font-size: 18px;
    float: left;
}
.icon-sty:BEFORE {
  content: '\2716';
  display: block;
  height: 20px;
  width: 20px;
  line-height: 20px;
  vertical-align: middle;
  text-align: center;
  color: #888;
  float: left;
  margin-left: -30px;
  margin-top: 5.3rem;
}
.p-sty {
  font-size: 10px;
  width: 80%;
  margin-left: 10%;
  text-align: right;
  color:#888888;
}
</style>


<template>
  <div class="contain order-list">
    <div>
      <input type="text" placeholder="请输入物流单号" class="ipt-sty" v-model="TracingNos" />
      <i class="icon-sty" v-on:click="TracingNos =''"></i>
      <p class="p-sty">物流单号核对无误后确认交货</p>
      <div class="btns" v-on:click="CKHandover()">确认交货</div>
    </div>
  </div>
</template>

<script>
import manageFooter from "@/components/core/footer/manage.footer.vue";
import { mapState } from "vuex";
export default {
  name: "delivery",
  components: {
    manageFooter,
  },
  data() {
    return {
      todolist: [],
      guid: "",
      PageIndex: 1,
      PageSize: 4,
      TracingNos: "",
      ScrollerConfig: {
        content: "上拉加载",
        downContent: "上拉加载",
        height: 0,
        loadingContent: "加载中...",
        upContent: "上拉加载",
      },
    };
  },
  computed: {
    userinfo() {
      return localStorage.getItem("userinfo")
        ? JSON.parse(localStorage.getItem("userinfo"))
        : null;
    },
  },
  watch: {},
  created() {
    this.TracingNos =this.$route.query.bbillno;
    this.$nextTick(() => {
      this.sechTxt = sessionStorage.sechtxt;
      if (sessionStorage.getItem("ConsumableTab")) {
        this.tabNo = sessionStorage.getItem("ConsumableTab") * 1;
        sessionStorage.removeItem("ConsumableTab");
      } else {
        this.tabNo = 0;
      }
    });
  },
  mounted() {
    this.$nextTick(function () {});
  },
  methods: {
    CKHandover() {
      if (!this.TracingNos) {
          this.Toast({
            message: "请输入物流单号！",
          });
          return;
      }
      let query = {
        Guid: this.$route.query.guid,
        TracingNos: this.TracingNos,
        StaffGuid:this.userinfo.StaffID,
        StaffName:this.userinfo.Name
      };
      this.Ajax.post("CKHandover", query).then((res) => {
        if (res.IsSuccess) {
          this.Toast({
            message: "交货完成",
          });
          this.$router.go(-1);
          // this.$router.push({
          //   path: "/takeDeliveryOrde",
          //   query: {
          //   },
          //});
        } else {
          this.Toast({
            message: "交货失败",
          });
        }
      });
    },
  },
};
</script>